package com.yt.lxh.model.search;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;

@Data
@Document(indexName = "sku", shards = 3)
public class SkuDoc {

    @Id
    private String id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String keyword;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String skuName;

    @Field(type = FieldType.Text, index = false)
    private String skuImg;

    @Field(type = FieldType.Text, index = false)
    private String skuDesc;

    @Field(type = FieldType.Keyword, index = false)
    private String price;

    @Field(type = FieldType.Keyword, index = false)
    private String categoryId;

    @Field(type = FieldType.Boolean)
    private Boolean onSale;

    @Field(type = FieldType.Integer)
    private Integer sort;

    @Field(type = FieldType.Text, index = false)
    private String tasteText;

    @Field(type = FieldType.Text, index = false)
    private String content;

    @Field(type = FieldType.Text, index = false)
    private String banner;

    @Field(type = FieldType.Boolean, index = false)
    private Boolean bannerType;

    @Field(type = FieldType.Text, index = false)
    private String alert;

    @Field(type = FieldType.Object, index = false)
    private List<String> ruleList;
}
